//模拟登录返回体
import Mock from 'mockjs'
import {builder,getBody} from '../util'
import headimg from '@/assets/daiban.png'
 
const user={
    // username:"user",password:123456
    token:'1',username:'man',avatar:headimg,info:'good man'
}

export const userLogin=options=>{
    const body=getBody(options)
    
    if(body.username=="admin"&&body.password==123456){
        
        return builder({ token:'1',username:'man',avatar:headimg,info:'good man'},"200")
    }else{
        return builder("密码错误","200")
    }
}

Mock.mock(/\/api\/user\/login/,'post',userLogin)